//
//  ViewModel.m
//  RACDemoOC
//
//  Created by SQ on 2020/1/19.
//  Copyright © 2020 shiqiao. All rights reserved.
//

#import "ViewModel.h"

@interface ViewModel ()



@end

@implementation ViewModel

+ (instancetype)viewModelWithUsernameSignal:(RACSignal *)username passwordSignal:(RACSignal *)password loginTapSignal:(RACSignal *)loginTap
{
    ViewModel *model = [[ViewModel alloc] init];
    [[username map:^id _Nullable(NSString   *  _Nullable value) {
        return @(value.length > 6);
    }]
     subscribeNext:^(id  _Nullable x) {
        NSLog(@"bool = %@",x);
    }];
    [username flattenMap:^__kindof RACSignal * _Nullable(NSString   * _Nullable value) {
        
        
        
        return [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber>  _Nonnull subscriber) {
            return subscriber;
        }];
    }];
    
    return model;
}

@end
